import UsersController from "./UsersController.js";
import CoursesController from "./CoursesController.js";
import HomeworkController from "./HomeworkController.js";
import AboutController from "./AboutController.js";

export default class RouteV1 {
    static configRoutes(router) {
        router.route('/users/').get(UsersController.apiGetUsers);
        router.route('/users/signup').post(UsersController.apiAddUser);
        router.route('/users/login').post(UsersController.apiLogin);

        router.route('/courses/').get(CoursesController.apiGetCourses);
        router.route('/course/').get(CoursesController.apiGetCourse);
        router.route('/course/').put(CoursesController.apiUpdateCourse);
        router.route('/courses/new').post(CoursesController.apiAddCourse);
        router.route('/courses/students').post(CoursesController.apiGetStudentsForCourse);
        router.route('/course/subscribe').post(CoursesController.apiSubscribeCourse);
        router.route('/course/issubscribe').post(CoursesController.apiIsSubscribe);

        router.route('/homework/').get(HomeworkController.apiGetHomework);
        router.route('/homework/').post(HomeworkController.apiAddHomework);
        router.route('/homework/submit').post(HomeworkController.apiSubmitHomework);
        router.route('/homework/score').post(HomeworkController.apiScoreHomework);
        router.route('/homework/reports').post(HomeworkController.apiGetReportsByHomeworkId);
        router.route('/homework/report').post(HomeworkController.apiGetReportByStudent);

        router.route('/about')
            .get(AboutController.apiGetAbout)
            .post(AboutController.apiUpdateAbout);
        return router;
    }
}
